//
//  JAGAdError.h
//  JAGatherAdDemo
//
//  Created by Yc on 2022/4/21.
//

#import <Foundation/Foundation.h>

NS_ASSUME_NONNULL_BEGIN
//1001-1999 初始化错误 2001-2999 广告加载错误
typedef NS_ENUM(NSUInteger, JAGAdErrorCode) {
    JAGAdErrorCodeSDKinitInvalidParameters           =   1001,//参数效验失败
    JAGAdErrorCodeSDKinitAccessServerFailed          =   1002,//访问服务器失败

    JAGAdErrorCodePlacementStrategyInvalidResponse   =   2001,//无效策略
    JAGAdErrorCodePlacementStragetyLoadingError      =   2002,//策略加载失败
    JAGAdErrorCodePlacementStrategyNotFound          =   2003,//没有策略
    JAGAdErrorCodeUnitGroupsLoadingFailed            =   2004,//流量组广告源加载失败（瀑布流结束）
    JAGAdErrorCodePocketBottomADLoadingFailed        =   2005,//兜底广告加载失败
    JAGAdErrorCodeShowTimesExceedsDayCap             =   2006,//展示或请求超过一天内最多展示次数
    JAGAdErrorCodeShowTimesExceedsHourCap            =   2007,//展示或请求超过小时内最多展示次数
    JAGAdErrorCodeShowTimesExceedsIntervalCap        =   2008,//展示或请求超过展示间隔
    JAGAdErrorCodeThirdSDKNotImported                =   2009,//没有导入第三方平台的SDK或导入了错误的版本
    JAGAdErrorCodeThirdSDKLoadingError               =   2010,//第三方平台注册加载失败
    JAGAdErrorCodeAdapterClassNotFound               =   2011,//没有导入对应的Adapter
    JAGAdErrorCodeUnitGroupsFilteredOut              =   2012,//广告源已过滤，当前没有广告源
    JAGAdErrorCodeUnitGroupsNotMeetRules             =   2013,//不满足流量组规则
    JAGAdErrorCodeAdBiddingFailed                    =   2014,//竞价失败
    JAGAdErrorCodeAdRequestFailed                    =   2015,//广告请求失败
    JAGAdErrorCodeAdExposureFailed                   =   2016,//广告曝光失败
    JAGAdErrorCodeAdRenderFailed                     =   2017,//广告渲染失败
    JAGAdErrorCodeAdVideoPlayFailed                  =   2018,//广告视频播放失败
    JAGAdErrorCodePlacementAdTypeMismatch            =   2019,//广告位的广告类型不匹配
    JAGAdErrorCodePlacementAdInvalid                 =   2020,//广告位无效（空值）
    JAGAdErrorCodePreviousLoadNotFinished            =   2021,//上一次的广告位请求还没返回
    JAGAdErrorCodePlacementAdSuspend                 =   2022,//广告位未启用，处于暂停状态
    
    JAGAdErrorCodeGatgerRequestFailed                =   3001,//接口错误
    JAGAdErrorCodeGatgerAnomaly                      =   3002,//异常错误
    JAGAdErrorCodeGatgerPlacementLoadTimeout         =   3003,//广告位加载超时
    JAGAdErrorCodeGatgerNotNetwork                   =   3004,//没有网络
    JAGAdErrorCodeGatgerConnectServerFailed          =   3005,//链接服务器失败
    JAGAdErrorCodeGatgerLoadBundleFailed             =   3006,//bundle资源加载失败
};

//错误类型
extern NSString *const JAGSDKInitErrorDomain;
extern NSString *const JAGADLoadingErrorDomain;
extern NSString *const JAGatgerSDKErrorDomain;

//错误码描述
extern NSString *const JAGAdErrorCodeDesc1001;
extern NSString *const JAGAdErrorCodeDesc1002;
extern NSString *const JAGAdErrorCodeDesc2001;
extern NSString *const JAGAdErrorCodeDesc2002;
extern NSString *const JAGAdErrorCodeDesc2003;
extern NSString *const JAGAdErrorCodeDesc2004;
extern NSString *const JAGAdErrorCodeDesc2005;
extern NSString *const JAGAdErrorCodeDesc2006;
extern NSString *const JAGAdErrorCodeDesc2007;
extern NSString *const JAGAdErrorCodeDesc2008;
extern NSString *const JAGAdErrorCodeDesc2009;
extern NSString *const JAGAdErrorCodeDesc2010;
extern NSString *const JAGAdErrorCodeDesc2011;
extern NSString *const JAGAdErrorCodeDesc2012;
extern NSString *const JAGAdErrorCodeDesc2013;
extern NSString *const JAGAdErrorCodeDesc2014;
extern NSString *const JAGAdErrorCodeDesc2015;
extern NSString *const JAGAdErrorCodeDesc2016;
extern NSString *const JAGAdErrorCodeDesc2017;
extern NSString *const JAGAdErrorCodeDesc2018;
extern NSString *const JAGAdErrorCodeDesc2019;
extern NSString *const JAGAdErrorCodeDesc2020;
extern NSString *const JAGAdErrorCodeDesc2021;
extern NSString *const JAGAdErrorCodeDesc2022;

extern NSString *const JAGAdErrorCodeDesc3001;
extern NSString *const JAGAdErrorCodeDesc3002;
extern NSString *const JAGAdErrorCodeDesc3003;
extern NSString *const JAGAdErrorCodeDesc3004;
extern NSString *const JAGAdErrorCodeDesc3005;
extern NSString *const JAGAdErrorCodeDesc3006;

@interface JAGAdError : NSObject

+ (NSError *)errorWithCode:(JAGAdErrorCode)code description:(NSString *)description reason:(NSString * _Nullable)reason;


@end

NS_ASSUME_NONNULL_END
